var moment = require('moment');

var timer = {};
timer.format = function(t) {
    return moment.unix(t).format("YYYY-MM-DD HH:mm:ss");
}

timer.getDateFormat = function(t) {

    var ft = moment.unix(t);
    console.log(ft.format('MM'));
    var year = ft.get('year');
    var month = ft.format('MM'); // 0 to 11
    var date = ft.format('DD');
    var hour = ft.format('HH:mm');
    return { year: year, month: month, date: date, hour: hour }
}

module.exports = timer;